# -*- coding: utf-8 -*-
"""
****************************
@Time    : 2021/4/25 21:07
@Author  : Candy
@File    : sqlconfig.py
****************************
"""
import os
import sys

from flask import Flask

from config.db import MYSQL_USER, MYSQL_PASS, MYSQL_DB, MYSQL_PORT, MYSQL_HOST

base_path = os.path.dirname(os.path.abspath(__file__))
sys.path.append(base_path)
app = Flask(__name__, template_folder=base_path + '/static/templates')
app.config["SQLALCHEMY_DATABASE_URI"] = "mysql+pymysql://%s:%s@%s:%s/%s" % (MYSQL_USER, MYSQL_PASS, MYSQL_HOST, MYSQL_PORT, MYSQL_DB)
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
